.section ".text.boot"

.globl _start
.globl	save_boot_params_ret
.type   save_boot_params_ret,%function

_start:
	j	save_boot_params
save_boot_params_ret:
	/* 关闭中断 */
	csrw sie, zero

	call _init_uart
	call print_asm

	/* 设置栈, 栈的大小为4KB */
	la sp, stacks_start
	li t0, 4096
	add sp, sp, t0

	/* 跳转到C语言 */
	tail kernel_main

print_asm:
	/* At this time the SP stack space has not been allocated,
     * save the return address ra to the temporary registers
	 */
	mv s1, ra
	la a0, boot_string
	call put_string_uart

	mv ra, s1
	ret

.section .data
.align  12
.global stacks_start
stacks_start:
	.skip 4096


.section .rodata
.align 3
.global boot_string
boot_string:
	.string "hello risc-v from asm \n"
